package com.sundablog.demo.action;

import com.sundablog.demo.service.IQueryService;
import com.sundablog.spring.framework.annotation.SDAutowired;
import com.sundablog.spring.framework.annotation.SDRequestMapping;
import com.sundablog.spring.framework.annotation.SDRequestParam;

import java.util.HashMap;
import java.util.Map;

/**
 * @Title:
 * @Package com.sundablog.demo.action
 * @Description: TODO
 * @author: 孙达
 * @date: 2020/04/16 15:34
 * @Copyright: All rights Reserved, Designed By www.sundablog.com
 */
public class PageAction {

    @SDAutowired
    IQueryService queryService;

    @SDRequestMapping("/first.html")
    public  Map<String,Object> query(@SDRequestParam("teacher") String teacher){
        String result = queryService.query(teacher);
        Map<String,Object> model = new HashMap<String,Object>();
        model.put("teacher", teacher);
        model.put("data", result);
        model.put("token", "123456");
        return model;
    }
}
